package com.yxw.yxnet_cd_center.customer_service.exception;


import com.yxw.yxnet_cd_center.common.enums.CommonErrorEnum;

/**
 * 自定义异常
 * @author Administrator
 */
public class RrException extends RuntimeException {
	private static final long serialVersionUID = 1L;
	
    private String msg;
    private String code = "500";
    
    public RrException(String msg) {
		super(msg);
		this.msg = msg;
	}
	
	public RrException(String msg, Throwable e) {
		super(msg, e);
		this.msg = msg;
	}
	
	public RrException(String msg, String code) {
		super(msg);
		this.msg = msg;
		this.code = code;
	}
	
	public RrException(String msg, String code, Throwable e) {
		super(msg, e);
		this.msg = msg;
		this.code = code;
	}

	public RrException(CommonErrorEnum errorCodeEnum) {
		super(errorCodeEnum.getDescription());
		this.msg = errorCodeEnum.getDescription();
		this.code = errorCodeEnum.getCode();
	}

	public RrException(CommonErrorEnum errorCodeEnum, Exception description) {
		super(errorCodeEnum.getCode(), description);
		this.msg = errorCodeEnum.getDescription();
		this.code = errorCodeEnum.getCode();
	}

	public RrException(CommonErrorEnum errorCodeEnum, String description) {
		super(description);
		this.msg = errorCodeEnum.getDescription();
		this.code = errorCodeEnum.getCode();
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	
}
